package com.joysuch.wwyt.patrol.mapper;

import com.joysuch.wwyt.core.bean.ResultDto;
import com.joysuch.wwyt.patrol.entity.PatrolPlanPointMapping;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zr
 * @since 2022-02-28
 */
@Repository
public interface PatrolPlanPointMappingMapper extends BaseMapper<PatrolPlanPointMapping> {

    /**
     * 根据检查计划ID查看其关联多少检查点
     * @param planId 检查计划id
     * @return
     */
    Long getNumByPlanId(Long planId);

    List<ResultDto> getNumByPlanIds(@Param("planIds") List<Long> planIds);

    /**
     * 将该计划id下的关系删除
     * @param planId
     */
    void disabledByPlanId(Long planId);

    void deleteMappingByPointId(Long pointId);

}
